IPB
 
Reply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> items.txt slot generator, for the lazy ppl...

pfft
post Dec 18 2004, 02:22 AM
Post #1





Group: Members
Posts: 7
Joined: 17-November 04
Member No.: 190



Extract the ff from data.grf
- idnum2itemdisplaynametable.txt
- itemslotcounttable.txt

itemslotgen.pl
CODE
#!/usr/bin/env perl
#itemslotgen.pl by pfft
#debugger included

open ITEMS, "idnum2itemdisplaynametable.txt";
open SLOTS, "itemslotcounttable.txt";
open OUT, ">items.txt";
open BUG, ">debug.txt";

$x = 0;
$z = 0;
$slot = 0;
$slot_cnt = 0;
$item_cnt = 0;

print BUG "#---ITEMS-WITH-SLOTS---#\n>\n";

while (<SLOTS>)
{
 if (($_ =~ "#.#") && (substr($&,1,1) != 0)) {
   @slot_id[$x] = $`;
   @slot_count[$x] = substr($&,1,1);
   print BUG ++$slot_cnt . ".\t" . @slot_count[$x] . "\t" . @slot_id[$x] . "\n";
   $x++;
 }
}

print BUG "\n#---SLOTS-ADDED-TO-ITEMS---#\n>\n";

while (<ITEMS>)
{
 if ($_ =~ "#") {
   for ($y=0; $y<$x; $y++) {
     if ($` == @slot_id[$y]) {
       print OUT substr($_,0,-2) . "[" . @slot_count[$y] . "]#\n";
       print BUG ++$item_cnt . ".\t" . @slot_count[$y] . "\t" . $_;
       @item_id[$z++] = $`;
       $slot = 1;
     }
   }
 }

 if ($slot == 0) { print OUT $_; }
 else { $slot = 0; }
}

print BUG "\n#---INFO---#\n>\n";

if ($slot_cnt == $item_cnt) { print BUG "count match...\n"; }
else {
 for ($y=0; $y<$item_cnt; $y++) {
   for ($x=0; $x<$slot_cnt; $x++) {
     if (@slot_id[$x] == @item_id[$y]) { @slot_id[$x] = "#"; }
   }
 }
 for ($x=0; $x<$slot_cnt; $x++) {
   if (@slot_id[$x] != "#") { print BUG @slot_id[$x] . " has no match...\n"; }
 }
}

close ITEMS;
close SLOTS;
close OUT;
close BUG;

Put all 3 files in same dir and run itemslotgen.pl
EDIT: Added a little debugger just to make things sure... Also change the name of the pl file tongue.gif

This post has been edited by pfft: Jan 9 2005, 09:18 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
3X31
post Dec 25 2004, 11:27 AM
Post #2


Leecher


Group: Members
Posts: 112
Joined: 17-November 04
From: C:modkorehybridrebirth/ modkore-hybrid.exe (actually from Malaysia/Selangor)
Member No.: 146



cool!


--------------------
$players = player in RO
$botters = botters in RO
$factors = $botters / $players * 100

print "RO current stats",
if ( $factors == 0)
{ print "RO brankcrupt/n" }
elsif ( $factors >= 0 and $factors <20)
{ print "RO gonna to brankcrupt very soon/n" }
elsif ( $factors >= 20 and $factors <40)
{ print "RO is poor/n" }
elsif ( $factors >= 40 and $factors <60)
{ print "RO is normal/n" }
elsif ( $factors >= 60 and $factors <= 100)
{ print "RO is very rich!!!!!!!!/n" }
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
3X31
post Dec 25 2004, 11:32 AM
Post #3


Leecher


Group: Members
Posts: 112
Joined: 17-November 04
From: C:modkorehybridrebirth/ modkore-hybrid.exe (actually from Malaysia/Selangor)
Member No.: 146



if u all r lazy to use above method, this is the item.txt for ero

Attached File(s)
Attached File  items.txt ( 29.06k ) Number of downloads: 579


--------------------
$players = player in RO
$botters = botters in RO
$factors = $botters / $players * 100

print "RO current stats",
if ( $factors == 0)
{ print "RO brankcrupt/n" }
elsif ( $factors >= 0 and $factors <20)
{ print "RO gonna to brankcrupt very soon/n" }
elsif ( $factors >= 20 and $factors <40)
{ print "RO is poor/n" }
elsif ( $factors >= 40 and $factors <60)
{ print "RO is normal/n" }
elsif ( $factors >= 60 and $factors <= 100)
{ print "RO is very rich!!!!!!!!/n" }
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dromar
post Dec 25 2004, 07:45 PM
Post #4





Group: Approved Member
Posts: 31
Joined: 2-December 04
Member No.: 2,349



this is nice! no1.gif
this is so useful stuff no1.gif tongue.gif


--------------------
ZAFT no tameni!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genesis234
post Dec 29 2004, 07:04 PM
Post #5


modKore Cavalry Commander
****

Group: Members
Posts: 634
Joined: 19-November 04
From: modKorian Castle
Member No.: 759



Thanks a lot! Better pin this up you know....Oh,and just to let the ppl know,this items.txt version is shown in brackets ( [] ) for example

you wish to kill pupas,also yu want to pick up slotted guards.For example also,that you want at least 5 guards,and put it all in storage

So,in you items_control.txt you must put

CODE
Guard[1] 5 1 0


Explanation : Bot will pick up the guard,5 maximum,and store it all

This post has been edited by genesis234: Dec 29 2004, 07:08 PM


--------------------
...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
mgm_
post Dec 29 2004, 09:08 PM
Post #6


Active Member
**

Group: reBirth Modders
Posts: 258
Joined: 17-November 04
Member No.: 304



This is a nice idea... but I'm not sure if it really belongs here, because it involves some Client modification (.grf extraction).

Let's ask one of the Global Mods to decide if it's appropriate to 'PIN' this here.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genesis234
post Dec 29 2004, 09:14 PM
Post #7


modKore Cavalry Commander
****

Group: Members
Posts: 634
Joined: 19-November 04
From: modKorian Castle
Member No.: 759



Well,yes it is called modification...but hey!,at least this code is very helpful!


--------------------
...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Ozma
post Dec 30 2004, 07:45 AM
Post #8


Member
*

Group: Approved Member
Posts: 150
Joined: 18-November 04
Member No.: 449



wow thanks! this is great
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
terran197
post Jan 9 2005, 02:53 AM
Post #9





Group: Approved Member
Posts: 11
Joined: 18-November 04
Member No.: 586



i think this would be better pinned at the contributed board


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
rensuken
post Jan 9 2005, 05:55 AM
Post #10





Group: Members
Posts: 10
Joined: 17-December 04
Member No.: 3,818



also, keep in mind if you do implement this update and you have modkore

wep switch on different monters, you'll have to reconfig that 'cause the name

of the weapon will change. (as well as equiment too)

This post has been edited by rensuken: Jan 9 2005, 05:57 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Team5
post Jan 9 2005, 01:02 PM
Post #11


Leecher


Group: Approved Member
Posts: 62
Joined: 27-November 04
Member No.: 1,771



QUOTE(genesis234 @ Dec 29 2004, 12:04 PM)
Thanks a lot! Better pin this up you know....Oh,and just to let the ppl know,this items.txt version is shown in brackets ( [] ) for example

you wish to kill pupas,also yu want to pick up slotted guards.For example also,that you want at least 5 guards,and put it all in storage

So,in you items_control.txt you must put

CODE
Guard[1] 5 1 0


Explanation : Bot will pick up  the guard,5 maximum,and store it all
*




Green Potion 5 1 0

how come i cant make it pick max 5 green potion and leave the rest on the floor. mine keep on hetting green potion. do i need to insert new code for this? Thank i really really like this to work thanks.

This post has been edited by Team5: Jan 9 2005, 01:03 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
zpid3rman
post Jan 10 2005, 09:27 AM
Post #12


Leecher


Group: Members
Posts: 50
Joined: 18-November 04
Member No.: 492



as i know max number of loots is not determined by:

ex: Green Potion 5 1 0

5 - # of pcs to be left in the inventory, meaning if you pickup or you have more than 10 pcs of green pots in your inventory, the bot will store any excess whenever the bot use the storage. it does not determine the number of maximum item to be picked up.

1 - means to store an item or "0" if not

0 - means not to sell an item and 1 to sell

hope i'll help..... biggrin.gif


User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wapakwapak
post Jan 10 2005, 05:44 PM
Post #13





Group: Members
Posts: 9
Joined: 30-November 04
Member No.: 2,063



how can i put this code question.gif dem im a noob
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
NewForU
post Jan 25 2005, 10:15 PM
Post #14


Leecher


Group: Members
Posts: 59
Joined: 5-December 04
From: Malaysia - Penang
Member No.: 2,694



Sory ar , I got the following file :
- idnum2itemdisplaynametable.txt
- itemslotcounttable.txt
- itemslotgen.pl

But when i click the itemslotgen.pl it go to edit place , cant run one ?? y ?? need to have program ??


--------------------
MSN Me : ngcy02@hotmail.com
Email Me : ngcy02@yahoo.com


user posted image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
pfft
post Jan 26 2005, 10:14 AM
Post #15





Group: Members
Posts: 7
Joined: 17-November 04
Member No.: 190



QUOTE(wapakwapak @ Jan 10 2005, 06:44 PM)
how can i put this code question.gif dem im a noob
*




QUOTE(NewForU @ Jan 25 2005, 11:15 PM)
Sory ar , I got the following file :
- idnum2itemdisplaynametable.txt
- itemslotcounttable.txt
- itemslotgen.pl

But when i click the itemslotgen.pl it go to edit place , cant run one ?? y ?? need to have program ??
*



- Get a grf extractor and extract the files needed.
- Install ActivePerl "http://www.activestate.com/Products/ActivePerl/"
- Put all files in same dir and run pl file.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genesis234
post Jan 29 2005, 01:41 PM
Post #16


modKore Cavalry Commander
****

Group: Members
Posts: 634
Joined: 19-November 04
From: modKorian Castle
Member No.: 759



omg.gif Thats basic code injection.


--------------------
...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
keren2
post Today, 05:27 PM
Post #17





Group: Members
Posts: 22
Joined: 6-January 05
Member No.: 5,877



or maybe u all can use this code too...

Got this code from Openkore ^^

the output to items.txt a little bit changed

it will be like this

2102#Guard [1]# <-- have a space between guard and [1]

here's the code anyway

add_slot.pl
CODE

#!/usr/bin/perl
#float 17/04/2004

$displayname_tbl = 'idnum2itemdisplaynametable.txt';
$slotcount_tbl = 'itemslotcounttable.txt';
$outputfile = 'items.txt';

open (SOURCE, "< $displayname_tbl");
@source = <SOURCE>;
close SOURCE;

open (TABLE, "< $slotcount_tbl");

$count = 0;
#!/usr/bin/perl

while (<>) {
       @entry = split('#');
       $entry[1] =~ s/(^\s+)|(\s+$)|(\n)//g;
       $entry[1] =~ s/\s/_/g;
       print "$entry[0]#$entry[1]#\n";
}



close TABLE;
print "parsed $count entries from $slotcount_tbl\n";

open (OUT, "> $outputfile");
print OUT "// generated by floAt's add_slot.pl script based on [$displayname_tbl] and [$slotcount_tbl]\n\n";

$count = 0;
foreach (@source) {
       chomp;
       if (/(^\d+)\#([^\#]+)\#/) {
               if ($slotcount{$1}) {
                       print OUT "$1\#$2 [$slotcount{$1}]\#\n";

               }
               else {
                       print OUT "$_\n";
               }
       }
       else {
               print OUT "$_\n";
       }

       $count++;
}

close OUT;

print "generated $count entries in $outputfile\n";


the step is like the first code above....

Thx ^^

This post has been edited by keren2: Today, 05:28 PM
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (0 Guests and 1 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 17th April 2005 - 05:38 PM